package com.leigang.java.code.design.mode.templateMethod;

/**
 * @author leigang
 * @version 1.0
 * @desc 咖啡饮料
 * @date 2022/5/4 22:59
 **/
public abstract class AbstractCaffeineBeverage {
    public final void prepareRecipe() {
        boilWater();
        brew();
        pourInCup();
        addCondiments();
    }

    /**
     * 冲泡
     */
    public abstract void brew();

    /**
     * 添加调料
     */
    public abstract void addCondiments();

    final void boilWater() {
        System.out.println("Boiling water");
    }

    final void pourInCup() {
        System.out.println("Pouring into cup");
    }

}
